package com.jay.io.clazz;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.LineNumberReader;

public class LineNumberReaderCls {
	public static void main(String args[]) throws IOException {
		File f = new File(
				"D:/tools/eclipse-jee-indigo-SR1/workspace/javapkg7/src/main/java/generic/PECS.java");
		LineNumberReader lineNumberReader = new LineNumberReader(
				new FileReader(f));

		StringBuffer sb = new StringBuffer();
		String lineStr = lineNumberReader.readLine();
		while (lineStr != null) {
			sb.append(lineNumberReader.getLineNumber()).append(lineStr)
					.append("\n");
			lineStr = lineNumberReader.readLine();
		}
		System.out.println(sb.toString());
	}

}
